<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
  <div class="top">
    <!--<div class="left"></div>
    <div class="right"></div>-->
    <div> <!-- class =content Initially -->
    	<div>
				<div style="font:Verdana; font-size:24px; font:bold; display:inline-block"><?php echo $heading_title; ?></div>
				<div style="color:#a4a4a4; display:inline-block;padding-left:3px;"><?php echo sprintf($text_total_items, $total_items); ?></div>
				<?php // Customisation: Category description appears below category name
					if ($description) { ?>			
						<div style="color:#a4a4a4;"><?php echo $description; ?></div>		
				<?php } ?>			
			</div>
	</div>  
  
  <div> <?php // class="middle" Initially 94-110 ?>
  
    <?php // Customisation: We don''t want the sub-categories to appear
	/* if ($description) { ?>
    <div style="margin-bottom: 15px;"><?php echo $description; ?></div>
    <?php } ?>
    <?php if ($categories) { ?>
    <table class="list">
      <?php for ($i = 0; $i < sizeof($categories); $i = $i + 4) { ?>
      <tr>
        <?php for ($j = $i; $j < ($i + 4); $j++) { ?>
        <td width="25%"><?php if (isset($categories[$j])) { ?>
          <a href="<?php echo $categories[$j]['href']; ?>"><img src="<?php echo $categories[$j]['thumb']; ?>" title="<?php echo $categories[$j]['name']; ?>" alt="<?php echo $categories[$j]['name']; ?>" style="margin-bottom: 3px;" /></a><br />
          <a href="<?php echo $categories[$j]['href']; ?>"><?php echo $categories[$j]['name']; ?></a>
          <?php } ?></td>
        <?php } ?>
      </tr>
      <?php } ?>
    </table>
    <?php } */ ?>  
        
    <?php if ($total_items > 0) { ?>
    
	<div>	
		<?php // Search bar ?>
		<form action="" method="post">
			<table cellpadding="0" cellspacing="0" width="960">
			<tr>        
			<td style="background-color:#6699ff; color:#FFF;" width="120px" align="center">
				<?php echo $text_make_selection ?>
			</td>
			
			<td style="background-color:#99ccff;" width="75px" align="center">
			<?php // Price ?>
			<select id="" name="price" onchange="this.form.submit();">
			<option value="<?php echo $no_attribute_selected ?>">Price</option>
			<?php for($counter = $min_price; $counter <= $max_price; $counter++) { 
					$next_price_point = $counter + $price_increment;
					
					// If the next price point is past the maximum price, 
					// then it must be set to the maximum price
					if ($next_price_point > $max_price) {
						$next_price_point = $max_price;
					}					
			?>
			 <option value='<?php echo $counter . "_" . $next_price_point ?>'><?php echo sprintf($text_range, $counter, $next_price_point); ?></option>
			<?php $counter += $price_increment; 
				} // End for ?> 
			</select>
			
			</td>
			
            <?php /* ?>
			<td style="background-color:#99ccff;" width="75px" align="center">
			<?php // Brand/Manufacturer ?>
			<select id="" name="manufacturer" onchange="this.form.submit();">
			<option value='<?php echo $no_attribute_selected ?>'>Brand</option>
			<?php foreach ($manufacturers as $manufacturer) { ?>
			<option value='<?php echo $manufacturer['manufacturer_id']; ?>'><?php echo $manufacturer['name']; ?></option>      
			<?php } ?>          
			</select>
			</td>
            <?php */ ?>
			
			<td style="background-color:#99ccff;" width="75px" align="center">
			<select id="" name="vendor" onchange="this.form.submit();">
			<option value='<?php echo $no_attribute_selected ?>'>Store</option>
			<?php foreach ($vendors as $vendor) { ?>
			<option value='<?php echo $vendor['vendor_id']; ?>'><?php echo $vendor['name']; ?></option>      
			<?php } ?>    
			</select>
			</td>
			
			<?php // Populate additional search attributes 
			if (isset($category_attributes)) { 
						foreach ($category_attributes as $attribute) {
			?>
					<td style="background-color:#99ccff;" width="75px" align="center">
					<select name="attrib[<?php echo $attribute['attribute_id'] ?>]" onchange="this.form.submit();">
					<option value='<?php echo $no_attribute_selected ?>'><?php echo $attribute['name'] ?></option>
					<?php 
					// Remove the last separator character
					$delimited_string = rtrim($attribute['possible_values'],';');
					// Get the individual values
					$values  = explode(';', $delimited_string); 
							foreach($values as $value) { ?>
								<option value="<?php echo $value ?>"><?php echo $value ?></option>
							<?php } // End for values ?>
					</select>
				<?php } // End for ?>
					
			<?php } // End if ?>
			<?php // End additional search attributes ?>
			
			<?php // New arrivals ?>
			<td style="background-color:#ff9900;" width="100px" align="center">
			<input type="checkbox" name="new_items" onclick="this.form.submit();"/> New arrivals        
			</td>
			
			<?php // Products in promo ?>
			<td style="background-color:#ff0909;" width="100px" align="center">
			<input type="checkbox" name="promo_items" onclick="this.form.submit();"/> Items in promo
			</td>
			
			</tr>
			</table>
        </form>
		<?php // End search bar ?>
	    </div>
    </div>
	<?php /*
    <div class="sort" style="visibility:hidden;">
      <div class="div1">
        <select name="sort" onchange="location = this.value">
          <?php foreach ($sorts as $sorts) { ?>
          <?php if (($sort . '-' . $order) == $sorts['value']) { ?>
          <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
          <?php } else { ?>
          <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
          <?php } ?>
          <?php } ?>
        </select>
      </div>
      <div class="div2"><?php echo $text_sort; ?></div>
    </div>
    */ ?>
	<?php // Product display ?>
    <table class="list">
		<tr>
			<td colspan="4">
				<?php // Pagination ?>
				<div class="pagination" style="float:right;"><?php echo $pagination; ?></div>
			</td>
		</tr>
      <?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?>
      <tr>
        <?php for ($j = $i; $j < ($i + 4); $j++) { ?>
        <td width="25%"><?php if (isset($products[$j])) { ?>
			 
			<div align="center">
				<?php // Product image?>
				<a href="<?php echo $products[$j]['href']; ?>">
                	<img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" />
                </a>	
			</div>
				
				<div align="left">
					
					<div style="height:20px">
					<?php // If product is in promotion 
					  if ($products[$j]['special']) { ?> 
					  &nbsp;&nbsp;<span style="background-color:#ff0909; text-align:left; color:#ffffff; padding:2px;"><?php echo $text_promo ?></span>
					  <?php } ?>
					  <?php // If product is new 
					  if (isset($products[$j]['new']) && $products[$j]['new'] == "true") { ?> 
					  &nbsp;&nbsp;<span style="background-color:#ff9900; text-align:left; color:#ffffff; padding:2px;"><?php echo $text_new ?></span>
					  <?php } ?>
					 </div>
					 
					<?php //Product Model , Initial Colour = #999 ?>
					<div style="color: #000000; font-size: 11px; text-align:left;">&nbsp;&nbsp;<?php echo $products[$j]['model']; ?></div>
			  
				<?php //Price, colour from #900 to #000000 ?>	
				<?php if ($display_price) { ?>
					  <?php // If product is not in promotion 
					  if (!$products[$j]['special']) { ?>
						&nbsp;&nbsp;<span style="color: #000000; font-size:11px; font-weight: bold;"><?php echo $products[$j]['price']; ?></span>
					<?php } else { // Promotional prices ?>
							&nbsp;&nbsp;<span style="color: #000000; font-size:11px; font-weight: bold; " class="promotion_linethrough">
							<?php echo $products[$j]['price']; ?>
							</span>
							<span style="color: #019a34; font-size:11px; font-weight:bold; padding-left:10px"><?php echo "Promo Price : ". $products[$j]['special']; ?></span>						
					<?php } // End if for promotion ?>
			  <?php } ?>
			  <?php // Price end ?>
			  
				
				  <?php // Product rating
				  if ($products[$j]['rating']) { ?>
				  <img src="catalog/view/theme/default/image/stars_<?php echo $products[$j]['rating'] . '.png'; ?>" alt="<?php echo $products[$j]['stars']; ?>" />
				  <?php } ?>
				  
				  <?php // Product vendor -- vendor_information
				  if ($products[$j]['vendor']) { ?> 
					<div class="vendor_information" style="position:relative; left:4px;">
                    	<?php echo $products[$j]['vendor']['name']; ?>
                    </div>
				  <?php } // End if vendors?>		
				</div>
			
	
			<?php /* Hide Product Name
			<a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a><br /> */ ?>
          
			
			  
          <?php } ?>
          </td>
        <?php } ?>
      </tr>
      <?php } ?>
		<tr>
			<td colspan="4"><div class="pagination" style="float:right;"><?php echo $pagination; ?></div></td>
		</tr>
    </table>   
    <?php } else { // Nothing to display ?>
		<div><?php echo $text_no_items ?></div>
	<?php } ?>
  </div>
  
  <?php /* ?>
  <div class="bottom">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center"></div>
  </div>
  <?php */ ?>
  
</div>
</div>
<?php echo $footer; ?> 